package com.hgkj.cloud.base.common;

import java.util.Map;


public class PageInfoParams {

    public static Map<String, Object> setPageInfo(Integer page, Integer page_size, Map<String, Object> map) {
        PageInfo pi = new PageInfo();
        if (page != null) {
            pi.setCurrentPage(page);
        }
        if (page_size != null) {
            pi.setPageSize(page_size);
        }
        return buildMap(pi, map);
    }

    public static Map<String, Object> buildMap(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return map;
    }

}
